package com.tjsinfo.tjsoa.workplan.action;

import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.system.bo.ISystemUserBo;
import com.tjsinfo.tjsoa.system.vo.TSystemUser;
import com.tjsinfo.tjsoa.system.vo.User;
import com.tjsinfo.tjsoa.workplan.vo.WorkPlanMain;

public class CheckworkPlanHalfYearModleDownAction extends CheckDefalntWorkPlanMonthModleDownAction{
	private ISystemUserBo systemUserBo;
	
	public ISystemUserBo getSystemUserBo() {
		return systemUserBo;
	}

	public void setSystemUserBo(ISystemUserBo systemUserBo) {
		this.systemUserBo = systemUserBo;
	}

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		TSystemUser systemUser = systemUserBo.findByIdSystemUser(Integer.parseInt(request.getParameter("id")));
		request.setAttribute("systemUser", systemUser);
		Date date = getDate(request);
		User user = getUser(request);
		Map<Integer, WorkPlanMain> map = workPlanMainBo.selectWorkPlanTypeAndYearMAPNumberStart("H", 1900 + date.getYear(), user.getUser_id(), 1);
		return forword(mapping, request, date, map);
	}

}
